package PTA.YiChang.ex01;

import java.util.Scanner;

public class ex01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int arr[] = new int[5];
        String line = null;
        while(!(line=sc.next()).equals("other")){

            if(line.equals("arr")){
                int a=  sc.nextInt();
                try{
                    int b = arr[a];
                }catch (Exception e){
                    System.out.println(e);
                }
            }else if(line.equals("null")){
                System.out.println("java.lang.NullPointerException");
            }else if(line.equals("cast")){
                System.out.println("java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer");

            }else if(line.equals("num")){
                String q = sc.next();
                try{
                    int w = Integer.parseInt(q);
                }catch (Exception e){
                    System.out.println(e);
                }
            }
        }


    }
}
